#ifndef _DATAPARSE_H
#define _DATAPARSE_H

#include "stdlib.h"
#include "stdio.h"
#include "string.h"

#define DATA_HEAD 0xfe
#define CMD_SET_TIME 0x00
#define CMD_SET_CONF 0x01

typedef unsigned char u8;
typedef unsigned int u32;

typedef struct _DataPack
{
    u8 head;
    u8 len;
    u8 cmd;
    u8 *data;
} DataPack;

typedef enum _LEDMode
{
    LED_MODE_DYNAMIC = 1,
    LED_MODE_DYNAMIC_BREATH,
    LED_MODE_STATIC,
    LED_MODE_STATIC_BREATH
} LEDMode;

typedef struct _DeviceConf
{
    u8 ledState_;
    u8 ledMode_;
    u8 envDataEnable_;
    int timezoneOffset_;
    u32 colorValue_;
    u32 startSleepTime_;
    u32 endSleepTime_;
} DeviceConf;

u8 GenSetTimeData(u8 hour, u8 minute, u8 second, u8 **out);
u8 GenSetConfData(DeviceConf *deviceConf, u8 **out);

#endif